<template>
    <div>
      <van-nav-bar title="帮助反馈" left-arrow @click-left="$router.go(-1)"/>
      <div class="feedback">
          <textarea v-model="message" placeholder="请输入" class="feed-input"></textarea>
      </div>
      <div class="feed-btn">
          <button class="btn" @click="addHelp()">提交反馈</button>
      </div>
    </div>
</template>
<script>
import apiHttp from '../../../../api/index'
import { Toast } from 'vant'
export default {
    data(){
        return{
            message:"",
            userId:sessionStorage.getItem('userId')
        }
    },
    mounted(){},
    methods:{
        addHelp(){
            if(this.message == ''){
                Toast('反馈内容不能为空！')
                return
            }
            let parmes = {
                userId:this.userId,
                content:this.message
            }
            apiHttp.comIndex.addHelp(parmes,resp=>{
                if(resp.resultCode == '000000'){
                    Toast('反馈成功，我们将认真对待！')
                    this.$router.go(-1)
                }
            })
        }
    }
}
</script>

<style scoped>
.feedback{
    margin: 0.3rem auto;
    width: 92%;
}
.feed-input{
    width:100%;
    background-color:#ffffff;
    font-size: 0.7rem;
    color:#999999;
    padding: 0.3rem;
    height: 5rem;
    border-radius:4px;
    border:none; 
}
.feed-btn{
    text-align: center;
    margin: 0 auto;
}
.btn {
    border: none;
    width: 92%;
    line-height: 1.8rem;
    border-radius: 5px;
    background-color: #D33043;
    color: #FFFFFF;
    font-size: 0.8rem;
}
 </style>
